var mysql =require('mysql');
function chaxun(req){
	return new Promise((resolve,reject)=>{
		var connection=mysql.createConnection({
			host:'localhost',
			user:'root',
			password:'root',
			database:'timu'
		})
		connection.query(req,function(err,results,fields){
			if(err) {reject(err)};
			resolve(results);
			connection.end();
		})
	})
}
module.exports=chaxun
